package com.mall.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mall.entity.SmsSpikeCommodity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalTime;
import java.util.List;

@Mapper
public interface SmsSpikeCommodityMapper extends BaseMapper<SmsSpikeCommodity> {
    @Select("select product_id from sms_flash_promotion_product_relation where flash_promotion_session_id = #{sessionId}")
    List<Long> getProductId(@Param("sessionId") Integer sessionId);

    @Select("select * from sms_flash_promotion_product_relation where flash_promotion_session_id = #{sessionId} and product_id = #{productId}")
    SmsSpikeCommodity getProductRelation(@Param("sessionId") Integer sessionId,@Param("productId") Long productId);
}
